#ifndef POLY_H
#define POLY_H

#include "polytope/Poly_Operation.h"
#include "polytope/Space.h"
#include "1D_Space.h"
#include "2D_Space.h"
#include "3D_Space.h"
#include "crossbit/CFG.h"
#include <iostream>
#include <vector>
//zhunan designed in 2010-3-12
namespace polytope
{
	class Polytope
	{
		
		
		private:
			int dimension;//identify the dimension of the space
		//	Poly_Operation *Poly_Opt;//a pointer to the operation 
		public:
			Space_1D *one_dim_space;
			Space_2D *two_dim_space;
			Space_3D *three_dim_space;
		
		public:

			int Logical_Processor_Mapping(Poly_Operation op);//return the blockid
			int Logical_Processor_Group_Mapping();//return the gridid;
			Poly_Operation BFS_Search(Poly_Operation head);//since we are interested in the parallel part of the program, so the BFS is choosed straightforwardly
			int Code_Generation();//I'm not sure if I should write sth about this or it's the job of BOBO
			

			//zhunan 2010-3-23
			//override the construction functions
			Polytope();
			~Polytope();
			int Build_Polytope(VBlock *vb,CFG *cfg_builder,int dimension, int length);
			int Build_Polytope(VBlock *vb,CFG *cfg_builder,int dimension, int idx_L1, int idx_L2);
			int Build_Polytope(VBlock *vb,CFG *cfg_builder,int dimension, int idx_L1, int idx_L2, int idx_L3);
			//the above functions are not determined
	};

}


#endif
